package com.xyht.sca_s.student_manage_system.common.util;

import com.deepoove.poi.data.PictureType;
import org.springframework.stereotype.Component;

@Component
public class PictureUtil {

    public PictureType getPictureType (String type) {
        PictureType pictureType = PictureType.PNG;
        switch (type){
            case "png":
                pictureType = PictureType.PNG;
                break;
            case "jpg":
            case "jpeg":
                pictureType = PictureType.JPEG;
                break;
            case "gif":
                pictureType = PictureType.GIF;
                break;
            case "svg":
                pictureType = PictureType.SVG;
                break;
            case "emf":
                pictureType = PictureType.EMF;
                break;
            case "pict":
                pictureType = PictureType.PICT;
                break;
            case "dib":
                pictureType = PictureType.DIB;
                break;
            case "eps":
                pictureType = PictureType.EPS;
                break;
            case "bmp":
                pictureType = PictureType.BMP;
                break;
            case "wpg":
                pictureType = PictureType.WPG;
                break;

        }
        return pictureType;
    }

}
